home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-24 | 3.0 KB | 112 lines | [TEXT/MPS ] |
- unit GrabbugDcmd;
-
- (* ©1995 Quinn "The Eskimo!" *)
- (* This file is distributed as Freeware. *)
-
- (*
-
- Compiling Grabbug dcmd
- ----------------------
-
- 0. I compiled this with MPW Shell 3.3.1, UPI 2.0 and MPW Pascal 3.2.1.
- Your mileage might vary.
-
- 1. Use the MPW directory command to set the current directory to the folder
- containing this source file.
-
- 2. Modify the first line of the script in 3 so that the Dcmd variable points
- to your copy of MacsBug developer kit.
-
- 3. Execute the following script:
-
- Set Dcmd "SuperGrover:Languages:MacsBug Developer Kit:dcmds:"
- Export Dcmd
- Pascal GrabbugCommon.p
- Pascal -i "{Dcmd}dcmd Includes:" GrabbugDcmd.p
- Link -o "Grabbug" -c 'RSED' -t 'rsrc' -sg MyMain=PASLIB,Main ∂
- "{Dcmd}dcmd Libraries:"dcmdGlue.a.o ∂
- GrabbugDcmd.p.o ∂
- GrabbugCommon.p.o ∂
- "{Libraries}"Interface.o ∂
- "{Libraries}"Runtime.o ∂
- "{PLibraries}"PasLib.o
- BuildDcmd "Grabbug" 666 -format3
- Echo 'include "Grabbug";' | Rez -a -o "{SystemFolder}Debugger Prefs"
-
- 4. The TestDcmd program will not work with this dcmd, I think because
- it doesn't support format 3 dcmds.
-
- *)
-
- interface
-
- uses
- Types,
- TextUtils,
- Files,
- (* for some reason all UPI uses must go before Dcmd.p *sigh* *)
- Dcmd;
-
- procedure CommandEntry (paramPtr: dcmdBlockPtr);
-
- implementation
-
- uses
- GrabbugCommon;
-
- var
- refcon : longint;
-
- procedure CommandEntry (paramPtr: dcmdBlockPtr);
- var
- err : OSErr;
- errstr : Str255;
- errmsg : Str255;
- begin
- err := noErr;
- case paramPtr^.request of
- dcmdSecondaryInit :
- err := DoInit(refcon);
- dcmdShutdown :
- DoTerm(refcon);
- dcmdDoIt :
- begin
- dcmdSwapScreens;
- err := DoGrab(refcon);
- if err = noErr then begin
- dcmdDrawLine ('Snap!');
- end; (* if *)
- dcmdSwapScreens;
- end;
- dcmdHelp :
- begin
- dcmdDrawLine ('Grabbug');
- dcmdDrawLine (' Grabs screen to internal buffer. Use Grabbug Dump application to get it out again.');
- end;
- dcmdGetInfo :
- begin
- GetInfoRequestBlockPtr(paramPtr^.requestIOBlock)^.usageStr := '';
- GetInfoRequestBlockPtr(paramPtr^.requestIOBlock)^.creditsStr := '©1995 Quinn "The Eskimo!"';
- GetInfoRequestBlockPtr(paramPtr^.requestIOBlock)^.dcmdVersion.majorRev := $01;
- GetInfoRequestBlockPtr(paramPtr^.requestIOBlock)^.dcmdVersion.minorAndBugRev := $00;
- GetInfoRequestBlockPtr(paramPtr^.requestIOBlock)^.dcmdVersion.stage := betaStage;
- GetInfoRequestBlockPtr(paramPtr^.requestIOBlock)^.dcmdVersion.nonRelRev := $02;
- end;
- otherwise
- (* do nothing *)
- end; (* case *)
- if err <> noErr then begin
- NumToString(err, errstr);
- case err of
- screenSizeChangedErr :
- errmsg := 'The screen changed size between system startup time and the grab';
- noMainGDeviceErr :
- errmsg := 'Can’t find the main device (in which case how are you reading this message?)';
- otherwise
- errmsg := 'Unknown error';
- end; (* case *)
- dcmdDrawLine(concat('Grabbug error: ', errmsg, '. (', errstr, ')'));
- end; (* if *)
- end; (* CommandEntry *)
-
- end. (* GrabbugDcmd *)